//
//  FirstViewController.m
//  01-UIViewHomeWork
//
//  Created by dllo on 16/7/16.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "FirstViewController.h"
#import "SccondiewController.h"
#import "AccountView.h"
#import "ThirdViewController.h"
@interface FirstViewController ()

@end

@implementation FirstViewController

- (void)loadView
{
    [super loadView];
//    self.view.backgroundColor = [UIColor redColor];
    UIImageView *imageView1 = [[UIImageView alloc] initWithFrame:self.view.bounds];
    [self.view addSubview:imageView1];
    imageView1.image = [UIImage imageNamed:@"3"];

//    UIButton *button5 = [UIButton buttonWithType:UIButtonTypeCustom];
//    button5.frame = CGRectMake(50, 300, 250, 30);
//    button5.backgroundColor = [UIColor redColor];
//    [self.view addSubview:button5];
    
//    UIButton *button6 = [UIButton buttonWithType:UIButtonTypeCustom];
//    button6.frame = CGRectMake(50, 100, 250, 30);
//    button6.backgroundColor = [UIColor blueColor];
//    [self.view addSubview:button6];
    
    
    UIButton *button1 = [[UIButton alloc] initWithFrame:CGRectMake(20, 500, self.view.frame.size.width - 40, 40)];
    button1.backgroundColor = [UIColor greenColor];
    button1.alpha = 0.6;
    [button1 setTitle:@"返回登录" forState:UIControlStateNormal];
    
    [button1 addTarget:self action:@selector(button5Clicked) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button1];
    
    
    [button1 addTarget:self action:@selector(button5Clicked) forControlEvents:UIControlEventTouchUpInside];
    [button1 setTitle:@"注册拉钩" forState:UIControlStateNormal];
    UIButton *button2 = [[UIButton alloc] initWithFrame:CGRectMake(260, 390, 80, 20)];
    button2.backgroundColor = [UIColor clearColor];
    [button2 setTitle:@"忘记密码" forState:UIControlStateNormal];
    [button2 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button2 addTarget:self action:@selector(button2Clicked) forControlEvents:UIControlEventTouchUpInside];
    
    [self.view addSubview:button2];
    
    
    UIButton *button3 = [[UIButton alloc] initWithFrame:CGRectMake(20,430 , self.view.frame.size.width - 40, 40)];
    button3.backgroundColor = [UIColor greenColor];
    [button3 setTitle:@"登录" forState:UIControlStateNormal];
    [button3 setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [button3 addTarget:self action:@selector(button6Clicked) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button3];

    [button3 addTarget:self action:@selector(button6Clicked) forControlEvents:UIControlEventTouchUpInside];
    [button3 setTitle:@"登录" forState:UIControlStateNormal];
    
    AccountView *accountView = [[AccountView alloc] initWithFrame:CGRectMake(10,300, 350, 80)];
    
    accountView.layer.cornerRadius = 5;
    accountView.layer.masksToBounds = YES;
    [self.view addSubview:accountView];

    UIImageView *imageViewOfLogo = [[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width - 100) / 2, 100, 100, 150)];
    [self.view addSubview:imageViewOfLogo];
    //
    imageViewOfLogo.image = [UIImage imageNamed:@"2"];
    
    
    
    
    
}

- (void)button2Clicked
{
    NSLog(@"忘记密码");
    ThirdViewController *thirdViewController = [[ThirdViewController alloc] init];
    thirdViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentViewController:thirdViewController animated:YES completion:nil];
    
}

//- (void)button6Clicked
//{
//    SccondiewController *secondViewController = [[SccondiewController alloc] init];
//    secondViewController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
//    [self presentViewController:secondViewController animated:YES completion:nil];
//}


- (void)button5Clicked
{
    [self dismissViewControllerAnimated:YES completion:nil];
}


- (void)viewDidLoad {
    [super viewDidLoad];
//    
//    self.view.backgroundColor = [UIColor greenColor];
//    UIButton *button5 = [UIButton buttonWithType:UIButtonTypeCustom];
//    button5.frame = CGRectMake(150, 300, 50, 30);
//    button5.backgroundColor = [UIColor redColor];
//    [self.view addSubview:button5];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



@end
